home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Present…nuary (Partner) - Disc 1
/
The Apple Reference and Presentations Library (Disc 1)(January 1994).iso
/
Frame Technology
/
US English
/
FrameMaker 4-68K
/
System Extras
/
PS Printer 8.1.1
/
PSPrinter
/
PSPrinter.rsrc
/
PS_-8176
< prev
next >
Wrap
Text File
|
1993-10-08
|
5KB
|
375 lines
%%BeginFile: adobe_psp_level1_colorimage
%%Copyright: Copyright 1990-1993 Adobe Systems Incorporated. All Rights Reserved.
/testsystemdict
{
where
{
systemdict eq
{
true
}{
false
}ifelse
}{
false
}ifelse
}bd
/rgbclut Z
/bwclut Z
/ncolors 1 def
/colorimage where{pop true}{false}ifelse
{
/ncolors 0
statusdict begin
/processcolors where
{
pop
pop
processcolors
}{
/deviceinfo where
{pop deviceinfo/Colors known
{pop{deviceinfo/Colors get}}if
}if
}ifelse
end
store
ncolors 0 ne
{
/colorimage testsystemdict
/setcolortransfer testsystemdict
/currentcolortransfer testsystemdict
/currentcmykcolor testsystemdict
and and and not
{
/ncolors 0 store
}if
}if
}if
ncolors 1 ne ncolors 3 ne ncolors 4 ne and and{/ncolors 0 store}if
ncolors 1 ne dup startnoload
/expandfactor Z
/bwclut Z
/expandbw
{
expandfactor mul round cvi bwclut exch get 255 div
}bd
/:k
{
pop/bwclut xs
bpc dup 8 eq
{
pop 255
}{
4 eq
{
15
}{
3
}ifelse
}ifelse
/expandfactor xs
[
/expandbw load/exec load dup
currenttransfer exch
]cvx bind settransfer
iw ih bpc[iw 0 0 ih 0 0]setupimageproc
image
}bd
endnoload
ncolors dup 3 eq exch 4 eq or
not dup startnoload
/Dclut Z
/Cclut Z
/Bclut Z
/Aclut Z
/ncompute Z
/rclut Z
/gclut Z
/bclut Z
/bit3x Z
/bit1x Z
/concatutil
{
/exec load
7 -1 roll/exec load
}bd
/defsubclut
{
1 add getinterval store
}bd
/spconcattransfer
{
/Dclut xs
/Cclut xs
/Bclut xs
/Aclut xs
/ncompute exch load store
currentcolortransfer
[
{
Aclut ncompute
}
concatutil
]cvx
[
{
Bclut ncompute
}
concatutil
]cvx
[
{
Cclut ncompute
}
concatutil
]cvx
[
{
Dclut ncompute
}
concatutil
]cvx
setcolortransfer
}bd
/setuprgbcluts
{
/bit3x
rgbclut length
3 sub
store
/bit1x bit3x 3 idiv store
/rclut rgbclut store
/gclut rclut 1 bit3x defsubclut
/bclut rclut 2 bit3x defsubclut
}bd
endnoload
ncolors 3 ne
dup startnoload
/3compute
{
exch bit3x
mul
round
cvi
get 255 div
}bd
/:k
{
/rgbclut xs
/bwclut xs
setuprgbcluts
/3compute rclut gclut bclut dup
spconcattransfer
iw ih bpc[iw 0 0 ih 0 0]
[
setupimageproc/exec load
/dup load dup
]cvx
{}{}true 3 colorimage
}bd
endnoload
ncolors 4 ne
dup startnoload
/cmykindex Z
/bit4x Z
/cmykclut Z
/cclut Z
/mclut Z
/yclut Z
/kclut Z
/ftoint
{
1 exch sub 255 mul round cvi
}bd
/stuffclut
{
cmykindex 3 -1 roll put
}bd
/4compute{exch bit4x mul round cvi get 255 div}bd
/invalidcolortable? true def
/computecmykclut
{
setuprgbcluts
/bit4x
rgbclut length
3 idiv
4 mul
4 sub
store
/cmykclut bit4x 4 add string store
/cclut cmykclut store
/mclut cclut 1 bit4x defsubclut
/yclut cclut 2 bit4x defsubclut
/kclut cclut 3 bit4x defsubclut
/cmykindex 0 store
0 1 bit1x
{
dup/cmykindex exch
bit1x exch sub
4 mul store
3 mul dup
rclut exch get 255 div
exch dup
gclut exch get 255 div
exch
bclut exch get 255 div
setrgbcolor currentcmykcolor
ftoint
kclut stuffclut
ftoint
yclut stuffclut
ftoint
mclut stuffclut
ftoint
cclut stuffclut
}for
}bd
/:k
{
/rgbclut xs
/bwclut xs
invalidcolortable?
{
computecmykclut
}if
/4compute cclut mclut yclut kclut spconcattransfer
iw ih bpc[iw 0 0 ih 0 0]
[
setupimageproc/exec load
/dup load dup dup
]cvx
{}{}{}
true 4 colorimage
}bd
endnoload
ncolors 0 ne
dup startnoload
/byte Z
/$x Z
/padfix Z
/lookupandstore
{
3 mul
3 getinterval
putinterval exch
3 add exch 3 copy
}bd
/8lookup/lookupandstore load store
/4lookup
{
/byte 1 index store
-4 bitshift
lookupandstore
byte 15 and
lookupandstore
}bd
/2lookup
{
/byte 1 index store
-6 bitshift
lookupandstore
byte -4 bitshift
3 and
lookupandstore
byte -2 bitshift
3 and
lookupandstore
byte 3 and
lookupandstore
}bd
/colorexpand
{
$x 0 rgbclut
3 copy
7 -1 roll
/$l load
forall
pop pop pop pop pop
0 padfix getinterval
}bd
/createexpandstr
{
/$x exch $z length mul string store
}bd
/:k
{
/rgbclut xs
/bwclut xs
/$l
bpc 8 eq
{
3 createexpandstr
/8lookup
}{
bpc 4 eq
{
6 createexpandstr
/4lookup
}{
12 createexpandstr
/2lookup
}ifelse
}ifelse
load store
/padfix 3 iw mul store
iw ih 8[iw 0 0 ih 0 0]
[setupimageproc/exec load/colorexpand load/exec load]cvx
false 3 colorimage
}bd
endnoload
/colorimage where
{
systemdict eq
{
systemdict/setcmykcolor known
}{
true
}ifelse
}{
false
}ifelse
dup not startnoload
/:l
{
iw ih 8[iw 0 0 ih 0 0]
setupimageproc false 3
colorimage
}bd
dup not endnoload
dup startnoload
/str Z
/len Z
/smlen Z
/rstr Z
/gstr Z
/bstr Z
/rgbtogray
{
/str xs
/len str length store
/smlen len 3 idiv store
/rstr str store
/gstr str 1 len 1 sub getinterval store
/bstr str 2 len 2 sub getinterval store
str dup
0 1 smlen 1 sub
{
dup 3 mul
rstr 1 index get .3 mul
gstr 2 index get .59 mul add
bstr 3 -1 roll get .11 mul add
round cvi
put dup
}for
pop 0 smlen getinterval
}bd
/:l
{
iw ih 8[iw 0 0 ih 0 0]
[setupimageproc/exec load/rgbtogray load/exec load]cvx bind
image
}bd
endnoload
%%EndFile